package main

import (
	"fmt"
	"time"
)

func main() {
	fmt.Println("run main func")
	go Hello()	//启动协程
	go World()
	time.Sleep(5 * time.Second)
	fmt.Println("finish main func")
}

func Hello() {
	for i := 0; i < 10; i++ {
		fmt.Println("hello")
		time.Sleep(100 * time.Millisecond)	//休眠100ms
	}
}

func World() {
	for i := 0; i < 10; i++ {
		fmt.Println("world")
		time.Sleep(200 * time.Millisecond)	//休眠200ms
	}
}

